Throughout all the data analysis we’ve done, the datasets have become more fragmented - lexical recall, gist, and eye tracking datasets. I want to put them all together in one whole dataset again so we can perform some analyses more efficiently (particularly correlations). The only thing I need to remember is we’ll have a new column called eye_exclude and if it is set to TRUE it means we can’t include that row in any analysis relating to eye gaze (usually because that trial was less than 25% looking).
# Libraries
library(tidyverse)
library(lme4)
library(lmerTest)
library(scales)
library(viridis)
library(agricolae)
library(GGally)
# Load lex and eye data
cleanlexdata <- read_csv("cleandata.csv") %>%
select(-(forehead:total))
cleaneyedata <- read_csv("cleanpercentdata.csv") %>%
spread(aoi,percent) %>%
add_column(eye_exclude = FALSE)
# What rows were removed from the eye data back in 03eyegaze? Let's add back in
# With a new column - eye_exclude
removed <- anti_join(cleanlexdata, cleaneyedata) %>%
add_column(eye_exclude = TRUE)
eyelexdata <- bind_rows(cleaneyedata, removed)
# Load gist data
gist <- read_csv('gist_indiv.csv', col_types = cols(
participant = col_character(),
gist.fw1 = col_integer(),
gist.rv2 = col_integer(),
gist.fw3 = col_integer(),
gist.rv4 = col_integer()
)) %>%
gather(video, gist, gist.fw1:gist.rv4) %>%
mutate(video = str_sub(video,6,8))
# Presto, our full reunified dataset - 'fulldata'
# But I want to remove columns I don't want anymore and will recalculate later
fulldata <- left_join(eyelexdata, gist) %>%
select(-moutheye, -facechest, -face, -chest)We have some changes to make to the groups. First, fix Josh as learning ASL when he was 6. Next, drop the DeafNative Group and reclassify all who learned ASL < 3.9 as DeafEarly and ASL => 4.0 as DeafLate.
# Change Josh's AoASL to 6
fulldata <- fulldata %>%
mutate(aoasl = as.double(aoasl)) %>%
mutate(aoasl = case_when(
participant == "Josh" ~ 6,
TRUE ~ aoasl
))
# Reclassify Groups
fulldata <- fulldata %>%
mutate(maingroup = case_when(
hearing == "Deaf" & aoasl < 4 ~ "DeafEarly",
hearing == "Deaf" & aoasl >= 4 ~ "DeafLate",
maingroup == "HearingLateASL" ~ "HearingLate",
maingroup == "HearingNoviceASL" ~ "HearingNovice"
))
# Create Participant Demographics Table
participant_info <- fulldata %>%
select(-(acc:gist)) %>%
select(-(video:direction)) %>%
distinct() %>%
group_by(maingroup) %>%
summarise(n = n(),
age_mean = mean(age),
age_sd = sd(age),
aoasl_mean = mean(aoasl),
aoasl_sd = sd(aoasl),
signyrs_mean = mean(signyrs),
signyrs_sd = sd(signyrs),
selfrate_mean = mean(selfrate),
selfrate_sd = sd(selfrate)) %>%
ungroup() %>%
mutate_if(is.double, funs(round(., 2))) %>%
mutate(age = paste(age_mean, "±", age_sd, sep = " "),
aoasl = paste(aoasl_mean, "±", aoasl_sd, sep = " "),
signyrs = paste(signyrs_mean, "±", signyrs_sd, sep = " "),
selfrate = paste(selfrate_mean, "±", selfrate_sd, sep = " ")) %>%
select(-(age_mean:selfrate_sd))
participant_infoBelow are the ANOVA outputs for participant demographics, and LSDs for each.
Participants’ age
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 1810 603.3 14.29 8.75e-07 ***
Residuals 48 2026 42.2
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Participants’ AoASL
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 2553.9 851.3 89.98 <2e-16 ***
Residuals 48 454.1 9.5
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Participants’ Sign Yrs
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 7032 2344.1 59.37 3.52e-16 ***
Residuals 48 1895 39.5
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Participants’ Self-Rating
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 30.71 10.237 72.37 <2e-16 ***
Residuals 48 6.79 0.141
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Let’s generate a table for lexical recall and gist for forward vs. reversed stories.
lexgist_info <- fulldata %>%
group_by(maingroup, direction) %>%
summarise(lex_mean = mean(acc, na.rm = TRUE),
lex_sd = sd(acc, na.rm = TRUE),
gist_mean = mean(gist),
gist_sd = sd(gist)) %>%
ungroup() %>%
mutate_if(is.double, funs(round(., 2))) %>%
mutate(lex = paste(lex_mean, "±", lex_sd, sep = " "),
gist = paste(gist_mean, "±", gist_sd, sep = " ")) %>%
select(-(lex_mean:gist_sd)) %>%
gather(metric, value, lex:gist) %>%
unite("metric", c(metric, direction), sep = "_") %>%
spread(metric, value) %>%
print()And then bar charts too after that with error bars.
# Gist bar chart
gist_bar <- fulldata %>% select(participant, maingroup, direction, gist) %>%
group_by(maingroup, participant, direction) %>%
summarise(gist = mean(gist)) %>%
group_by(maingroup, direction) %>%
summarise(mean = mean(gist),
sd = sd(gist),
count = n(),
se = sd/sqrt(count))
ggplot(gist_bar, aes(x = maingroup, y = mean, fill = direction)) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_errorbar(aes(ymin = mean-se, ymax = mean+se), position = position_dodge(0.9), width = 0.5) +
labs(title = "Story Comprehension (Gist)", subtitle = "Error bars represent SE", x = "", y = "mean gist") +
scale_y_continuous(labels = percent, limits = c(0,1))# Lex bar chart
lex_bar <- fulldata %>% select(participant, maingroup, direction, acc) %>%
group_by(maingroup, participant, direction) %>%
summarise(acc = mean(acc, na.rm = TRUE)) %>%
group_by(maingroup, direction) %>%
summarise(mean = mean(acc, na.rm = TRUE),
sd = sd(acc, na.rm = TRUE),
count = n(),
se = sd/sqrt(count))
ggplot(lex_bar, aes(x = maingroup, y = mean, fill = direction)) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_errorbar(aes(ymin = mean-se, ymax = mean+se), position = position_dodge(0.9), width = 0.5) +
labs(title = "Lexical Recall", subtitle = "Error bars represent SE", x = "", y = "mean accuracy") +
scale_y_continuous(labels = percent, limits = c(0,1)) +
geom_hline(yintercept = .5, linetype = "dotted") +
coord_cartesian(ylim = c(.5,1))Next, we’re going to do ANOVAs and ANCOVAs. We’ll always do it in this order. The first three ANOVAs will be followed by LSD of the four maingroups with uncorrected p-values.
I did not include Age as a covariate in the first 3 ANOVAs because they did not add to or change the model in any significant way.
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 3.002 1.001 13.284 2.53e-07 ***
direction 1 5.310 5.310 70.491 4.10e-13 ***
maingroup:direction 3 0.896 0.299 3.965 0.0103 *
Residuals 96 7.232 0.075
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 2.477 0.8256 16.11 2.23e-07 ***
Residuals 48 2.461 0.0513
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Kruskal-Wallis rank sum test
data: gist by maingroup
Kruskal-Wallis chi-squared = 25.46, df = 3, p-value = 1.237e-05
Chi-squared approximation may be incorrect
Pearson's Chi-squared test
data: gist_chisq_fw
X-squared = 26.984, df = 6, p-value = 0.0001458
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 1.421 0.4737 4.766 0.00548 **
Residuals 48 4.771 0.0994
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Kruskal-Wallis rank sum test
data: gist by maingroup
Kruskal-Wallis chi-squared = 11.365, df = 3, p-value = 0.009907
Chi-squared approximation may be incorrect
Pearson's Chi-squared test
data: gist_chisq_rv
X-squared = 15.056, df = 6, p-value = 0.01982
Df Sum Sq Mean Sq F value Pr(>F)
direction 1 5.310 5.310 61.435 6.24e-12 ***
aoasl 1 1.435 1.435 16.602 9.50e-05 ***
age 1 0.524 0.524 6.058 0.0156 *
direction:aoasl 1 0.033 0.033 0.386 0.5360
direction:age 1 0.216 0.216 2.493 0.1176
aoasl:age 1 0.579 0.579 6.703 0.0111 *
direction:aoasl:age 1 0.045 0.045 0.524 0.4707
Residuals 96 8.298 0.086
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Call:
lm(formula = gist ~ aoasl * age, data = filter(participant_data,
direction == "forward"))
Residuals:
Min 1Q Median 3Q Max
-0.64682 -0.04576 0.00158 0.12355 0.42535
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.0541328 0.2576559 4.091 0.000163 ***
aoasl -0.0551054 0.0184504 -2.987 0.004431 **
age -0.0016630 0.0074651 -0.223 0.824659
aoasl:age 0.0015158 0.0005719 2.650 0.010863 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.2599 on 48 degrees of freedom
Multiple R-squared: 0.3434, Adjusted R-squared: 0.3023
F-statistic: 8.366 on 3 and 48 DF, p-value: 0.0001409
Call:
lm(formula = gist ~ aoasl * age, data = filter(participant_data,
direction == "reversed"))
Residuals:
Min 1Q Median 3Q Max
-0.63610 -0.22752 0.02114 0.24941 0.61943
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.8059325 0.3217367 2.505 0.0157 *
aoasl -0.0431909 0.0230392 -1.875 0.0669 .
age -0.0058563 0.0093218 -0.628 0.5328
aoasl:age 0.0008532 0.0007142 1.195 0.2381
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.3245 on 48 degrees of freedom
Multiple R-squared: 0.1836, Adjusted R-squared: 0.1326
F-statistic: 3.598 on 3 and 48 DF, p-value: 0.02002
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.1175 0.0392 5.348 0.00189 **
direction 1 0.5211 0.5211 71.149 3.38e-13 ***
maingroup:direction 3 0.0294 0.0098 1.336 0.26731
Residuals 96 0.7031 0.0073
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.04988 0.016626 2.984 0.0404 *
Residuals 48 0.26749 0.005573
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.0970 0.03233 3.562 0.0209 *
Residuals 48 0.4356 0.00908
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Df Sum Sq Mean Sq F value Pr(>F)
direction 1 0.5211 0.5211 69.354 5.72e-13 ***
aoasl 1 0.0431 0.0431 5.731 0.0186 *
age 1 0.0347 0.0347 4.621 0.0341 *
direction:aoasl 1 0.0204 0.0204 2.716 0.1026
direction:age 1 0.0094 0.0094 1.253 0.2658
aoasl:age 1 0.0195 0.0195 2.602 0.1100
direction:aoasl:age 1 0.0015 0.0015 0.202 0.6540
Residuals 96 0.7213 0.0075
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Call:
lm(formula = acc ~ aoasl * age, data = filter(participant_data,
direction == "forward"))
Residuals:
Min 1Q Median 3Q Max
-0.223429 -0.032150 0.004461 0.039614 0.205706
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.7878168 0.0743596 10.595 3.69e-14 ***
aoasl -0.0045003 0.0053248 -0.845 0.402
age 0.0017563 0.0021544 0.815 0.419
aoasl:age 0.0001569 0.0001651 0.951 0.347
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.07501 on 48 degrees of freedom
Multiple R-squared: 0.1491, Adjusted R-squared: 0.09593
F-statistic: 2.804 on 3 and 48 DF, p-value: 0.04966
Call:
lm(formula = acc ~ aoasl * age, data = filter(participant_data,
direction == "reversed"))
Residuals:
Min 1Q Median 3Q Max
-0.243150 -0.053718 0.000822 0.061438 0.212639
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.8084021 0.0961239 8.410 5.33e-11 ***
aoasl -0.0127774 0.0068833 -1.856 0.0696 .
age -0.0018529 0.0027850 -0.665 0.5090
aoasl:age 0.0002782 0.0002134 1.304 0.1985
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.09696 on 48 degrees of freedom
Multiple R-squared: 0.1527, Adjusted R-squared: 0.09977
F-statistic: 2.884 on 3 and 48 DF, p-value: 0.04527
Next, we want to look at correlations between AoA and Gist, and betwen AoA and Lexical Recall. Rain asked for forward and reversed separately (1) deaf only, (2) hearing only, and (3) both. Let’s make it work.
# Let's make participant-level data, and have forward/reversed in separate columns
lexgist_data <- fulldata %>%
group_by(maingroup, participant, direction) %>%
mutate(gist = mean(gist, na.rm = TRUE),
lex = mean(acc, na.rm = TRUE)) %>%
ungroup() %>%
select(maingroup, participant, hearing, direction, aoasl, signyrs, age, gist, lex) %>%
distinct() %>%
gather(metric, value, gist:lex) %>%
unite(metricvalue, c(metric, direction), sep = "_") %>%
spread(metricvalue, value) %>%
select(-participant, -maingroup)
lexgist_deaf <- lexgist_data %>% filter(hearing == "Deaf") %>% select(-hearing)
lexgist_hearing <- lexgist_data %>% filter(hearing == "Hearing") %>% select(-hearing)
lexgist_all <- lexgist_data %>% select(-hearing)
# Load awesome function to make correlation tables with stars for significance
# From: https://myowelt.blogspot.co.uk/2008/04/beautiful-correlation-tables-in-r.html
corstarsl <- function(x){
require(Hmisc)
x <- as.matrix(x)
R <- Hmisc::rcorr(x)$r
p <- Hmisc::rcorr(x)$P
## define notions for significance levels; spacing is important.
mystars <- ifelse(p < .001, "***", ifelse(p < .01, "** ", ifelse(p < .05, "* ", " ")))
## trunctuate the matrix that holds the correlations to two decimal
R <- format(round(cbind(rep(-1.11, ncol(x)), R), 2))[,-1]
## build a new matrix that includes the correlations with their apropriate stars
Rnew <- matrix(paste(R, mystars, sep=""), ncol=ncol(x))
diag(Rnew) <- paste(diag(R), " ", sep="")
rownames(Rnew) <- colnames(x)
colnames(Rnew) <- paste(colnames(x), "", sep="")
## remove upper triangle
Rnew <- as.matrix(Rnew)
Rnew[upper.tri(Rnew, diag = TRUE)] <- ""
Rnew <- as.data.frame(Rnew)
## remove last column and return the matrix (which is now a data frame)
Rnew <- cbind(Rnew[1:length(Rnew)-1])
return(Rnew)
}
# Correlations for Deaf
print("DEAF Correlations - Pearson's r")[1] "DEAF Correlations - Pearson's r"
#corstarsl(lexgist_deaf)
Hmisc::rcorr(as.matrix(lexgist_deaf))$r aoasl signyrs age gist_forward gist_reversed lex_forward lex_reversed
aoasl 1.00000000 -0.50188273 0.2569266 0.08266371 -0.25585943 0.14743346 -0.25601873
signyrs -0.50188273 1.00000000 0.7005996 0.18321127 -0.01264108 0.27968505 0.06666998
age 0.25692660 0.70059955 1.0000000 0.27454460 -0.17264941 0.42997837 -0.12765634
gist_forward 0.08266371 0.18321127 0.2745446 1.00000000 0.01762269 -0.08155560 -0.09770666
gist_reversed -0.25585943 -0.01264108 -0.1726494 0.01762269 1.00000000 0.02667231 0.36021802
lex_forward 0.14743346 0.27968505 0.4299784 -0.08155560 0.02667231 1.00000000 0.35984892
lex_reversed -0.25601873 0.06666998 -0.1276563 -0.09770666 0.36021802 0.35984892 1.00000000
print("DEAF Correlations - P-values")[1] "DEAF Correlations - P-values"
Hmisc::rcorr(as.matrix(lexgist_deaf))$P aoasl signyrs age gist_forward gist_reversed lex_forward lex_reversed
aoasl NA 5.536857e-03 1.784812e-01 0.6698839 0.18035489 0.44533530 0.18007434
signyrs 0.005536857 NA 2.316796e-05 0.3414473 0.94810844 0.14172236 0.73113301
age 0.178481213 2.316796e-05 NA 0.1495001 0.37046625 0.01990877 0.50930544
gist_forward 0.669883883 3.414473e-01 1.495001e-01 NA 0.92770438 0.67406661 0.61409897
gist_reversed 0.180354888 9.481084e-01 3.704662e-01 0.9277044 NA 0.89076140 0.05492031
lex_forward 0.445335297 1.417224e-01 1.990877e-02 0.6740666 0.89076140 NA 0.05518766
lex_reversed 0.180074336 7.311330e-01 5.093054e-01 0.6140990 0.05492031 0.05518766 NA
cat(paste("","\n",""))# Correlations for Hearing
print("HEARING Correlations - Pearson's r")[1] "HEARING Correlations - Pearson's r"
#corstarsl(lexgist_hearing)
Hmisc::rcorr(as.matrix(lexgist_hearing))$r aoasl signyrs age gist_forward gist_reversed lex_forward lex_reversed
aoasl 1.00000000 -0.07887013 0.3468184 -0.15525565 0.07815751 0.02500269 0.01411303
signyrs -0.07887013 1.00000000 0.9021947 0.57814670 0.28845748 0.36725658 0.20828810
age 0.34681845 0.90219468 1.0000000 0.44651473 0.30963454 0.30931753 0.20139593
gist_forward -0.15525565 0.57814670 0.4465147 1.00000000 0.29502174 0.57154566 0.07645807
gist_reversed 0.07815751 0.28845748 0.3096345 0.29502174 1.00000000 0.35682374 0.57951176
lex_forward 0.02500269 0.36725658 0.3093175 0.57154566 0.35682374 1.00000000 0.36558339
lex_reversed 0.01411303 0.20828810 0.2013959 0.07645807 0.57951176 0.36558339 1.00000000
print("HEARING Correlations - P-values")[1] "HEARING Correlations - P-values"
Hmisc::rcorr(as.matrix(lexgist_hearing))$P aoasl signyrs age gist_forward gist_reversed lex_forward lex_reversed
aoasl NA 7.205586e-01 1.049514e-01 0.479339909 0.722986497 0.909841021 0.949040176
signyrs 0.7205586 NA 4.046899e-09 0.003857505 0.181932462 0.084723426 0.340222805
age 0.1049514 4.046899e-09 NA 0.032691671 0.150502508 0.150942632 0.356794880
gist_forward 0.4793399 3.857505e-03 3.269167e-02 NA 0.171744860 0.004385475 0.728786878
gist_reversed 0.7229865 1.819325e-01 1.505025e-01 0.171744860 NA 0.094647552 0.003755275
lex_forward 0.9098410 8.472343e-02 1.509426e-01 0.004385475 0.094647552 NA 0.086260140
lex_reversed 0.9490402 3.402228e-01 3.567949e-01 0.728786878 0.003755275 0.086260140 NA
cat(paste("","\n",""))# Correlations for All
print("ALL Correlations - Pearson's r")[1] "ALL Correlations - Pearson's r"
#corstarsl(lexgist_all)
Hmisc::rcorr(as.matrix(lexgist_all))$r aoasl signyrs age gist_forward gist_reversed lex_forward lex_reversed
aoasl 1.00000000 -0.7852245 -0.3136458 -0.3230903 -0.3922803 -0.08115845 -0.3394521
signyrs -0.78522450 1.0000000 0.8314757 0.4956183 0.3356193 0.29698992 0.3182316
age -0.31364575 0.8314757 1.0000000 0.4602616 0.1930257 0.36318284 0.1886432
gist_forward -0.32309031 0.4956183 0.4602616 1.0000000 0.2712761 0.49279109 0.1521110
gist_reversed -0.39228034 0.3356193 0.1930257 0.2712761 1.0000000 0.21701819 0.4921550
lex_forward -0.08115845 0.2969899 0.3631828 0.4927911 0.2170182 1.00000000 0.3800772
lex_reversed -0.33945209 0.3182316 0.1886432 0.1521110 0.4921550 0.38007715 1.0000000
print("ALL Correlations - P-values")[1] "ALL Correlations - P-values"
Hmisc::rcorr(as.matrix(lexgist_all))$P aoasl signyrs age gist_forward gist_reversed lex_forward lex_reversed
aoasl NA 5.523138e-12 2.356068e-02 0.0194786567 0.0040239673 0.5673489939 0.0138201778
signyrs 5.523138e-12 NA 2.309264e-14 0.0001870211 0.0150006737 0.0325116001 0.0214967644
age 2.356068e-02 2.309264e-14 NA 0.0005965582 0.1703671221 0.0081373882 0.1804672184
gist_forward 1.947866e-02 1.870211e-04 5.965582e-04 NA 0.0517394597 0.0002061625 0.2817023354
gist_reversed 4.023967e-03 1.500067e-02 1.703671e-01 0.0517394597 NA 0.1222542968 0.0002107074
lex_forward 5.673490e-01 3.251160e-02 8.137388e-03 0.0002061625 0.1222542968 NA 0.0054478274
lex_reversed 1.382018e-02 2.149676e-02 1.804672e-01 0.2817023354 0.0002107074 0.0054478274 NA
I’m also including nicely formatted tables with *** indicators of significance for quick referencing. Order: Deaf, Hearing, All.
corstarsl(lexgist_deaf)corstarsl(lexgist_hearing)corstarsl(lexgist_all)Let’s visualize what’s happening with the correlations here.
ggpairs(lexgist_data, columns = c(2:8), aes(color = hearing))
plot: [1,1] [==--------------------------------------------------------------------------] 2% est: 0s
plot: [1,2] [===-------------------------------------------------------------------------] 4% est: 4s
plot: [1,3] [=====-----------------------------------------------------------------------] 6% est: 4s
plot: [1,4] [======----------------------------------------------------------------------] 8% est: 4s
plot: [1,5] [========--------------------------------------------------------------------] 10% est: 4s
plot: [1,6] [=========-------------------------------------------------------------------] 12% est: 3s
plot: [1,7] [===========-----------------------------------------------------------------] 14% est: 3s
plot: [2,1] [============----------------------------------------------------------------] 16% est: 3s
plot: [2,2] [==============--------------------------------------------------------------] 18% est: 3s
plot: [2,3] [================------------------------------------------------------------] 20% est: 3s
plot: [2,4] [=================-----------------------------------------------------------] 22% est: 3s
plot: [2,5] [===================---------------------------------------------------------] 24% est: 3s
plot: [2,6] [====================--------------------------------------------------------] 27% est: 3s
plot: [2,7] [======================------------------------------------------------------] 29% est: 3s
plot: [3,1] [=======================-----------------------------------------------------] 31% est: 3s
plot: [3,2] [=========================---------------------------------------------------] 33% est: 3s
plot: [3,3] [==========================--------------------------------------------------] 35% est: 3s
plot: [3,4] [============================------------------------------------------------] 37% est: 3s
plot: [3,5] [=============================-----------------------------------------------] 39% est: 3s
plot: [3,6] [===============================---------------------------------------------] 41% est: 3s
plot: [3,7] [=================================-------------------------------------------] 43% est: 3s
plot: [4,1] [==================================------------------------------------------] 45% est: 3s
plot: [4,2] [====================================----------------------------------------] 47% est: 3s
plot: [4,3] [=====================================---------------------------------------] 49% est: 3s
plot: [4,4] [=======================================-------------------------------------] 51% est: 3s
plot: [4,5] [========================================------------------------------------] 53% est: 3s
plot: [4,6] [==========================================----------------------------------] 55% est: 3s
plot: [4,7] [===========================================---------------------------------] 57% est: 2s
plot: [5,1] [=============================================-------------------------------] 59% est: 2s
plot: [5,2] [===============================================-----------------------------] 61% est: 2s
plot: [5,3] [================================================----------------------------] 63% est: 2s
plot: [5,4] [==================================================--------------------------] 65% est: 2s
plot: [5,5] [===================================================-------------------------] 67% est: 2s
plot: [5,6] [=====================================================-----------------------] 69% est: 2s
plot: [5,7] [======================================================----------------------] 71% est: 2s
plot: [6,1] [========================================================--------------------] 73% est: 2s
plot: [6,2] [=========================================================-------------------] 76% est: 1s
plot: [6,3] [===========================================================-----------------] 78% est: 1s
plot: [6,4] [============================================================----------------] 80% est: 1s
plot: [6,5] [==============================================================--------------] 82% est: 1s
plot: [6,6] [================================================================------------] 84% est: 1s
plot: [6,7] [=================================================================-----------] 86% est: 1s
plot: [7,1] [===================================================================---------] 88% est: 1s
plot: [7,2] [====================================================================--------] 90% est: 1s
plot: [7,3] [======================================================================------] 92% est: 0s
plot: [7,4] [=======================================================================-----] 94% est: 0s
plot: [7,5] [=========================================================================---] 96% est: 0s
plot: [7,6] [==========================================================================--] 98% est: 0s
plot: [7,7] [============================================================================]100% est: 0s
Now eye gaze data. Boxplots first. Also here, we’re renaming “chin” to “neck” because that’s what it actually is! But we also have to fix all NA’s in the percentages to zeros, becuase that’s what they actually are.
# rename chin to neck
fulldata <- fulldata %>%
rename(neck = chin) %>%
gather(aoi, percent, belly:upperchest)
# Fix all NA's in Percent column to 0
fixpercent <- fulldata$percent
fulldata$percent <- coalesce(fixpercent, 0)
fulldata <- fulldata %>%
spread(aoi, percent)
fulldata %>%
filter(eye_exclude == FALSE) %>%
select(direction, belly:upperchest) %>%
gather(aoi, percent, belly:upperchest) %>%
ggplot(aes(x = aoi, y = percent, fill = direction)) + geom_boxplot()But let’s try error charts too! Instead of boxplots.
fulldata_error <- fulldata %>%
filter(eye_exclude == FALSE) %>%
gather(aoi, percent, belly:upperchest) %>%
group_by(id, direction, aoi) %>%
summarise(percent = mean(percent, na.rm = TRUE)) %>%
ungroup() %>%
distinct() %>%
group_by(direction, aoi) %>%
summarise(mean = mean(percent, na.rm = TRUE),
sd = sd(percent, na.rm = TRUE),
count = n(),
se = sd/sqrt(count))
fulldata_error$aoi <- fct_relevel(fulldata_error$aoi, c("forehead","eyes","mouth","neck","upperchest",
"midchest","lowerchest","belly","left","right"))
fulldata_error %>%
ggplot(aes(x = aoi, y = mean, fill = direction)) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_errorbar(aes(ymin = mean-se, ymax = mean+se), position = position_dodge(0.9), width = 0.5) +
labs(title = "Eye Gaze Behavior", subtitle = "Error bars represent SE", x = "", y = "percent looking") +
scale_y_continuous(labels = percent, limits = c(0,.75))Now we’re going to try a three-way Group x Direction x AOI ANOVA with the top 3 AOIs (Eyes, Mouth, Neck)
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.031 0.010 0.190 0.90322
direction 1 0.012 0.012 0.218 0.64069
aoi 2 11.416 5.708 106.365 < 2e-16 ***
maingroup:direction 3 0.002 0.001 0.013 0.99797
maingroup:aoi 6 0.979 0.163 3.039 0.00676 **
direction:aoi 2 0.329 0.164 3.065 0.04820 *
maingroup:direction:aoi 6 0.079 0.013 0.246 0.96078
Residuals 285 15.294 0.054
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
So we have significant maingroup:aoi and direction:aoi interactions. Let’s try to visualize what can be driving these. We can go back to the SEM chart but break it down…
First are the maingroup:aoi charts The error bars are not 100% accurate, I took a quick-n-easy way around
aoi3_interactions_maingroupaoi <- fulldata %>%
filter(eye_exclude == FALSE) %>%
select(id, participant, maingroup, direction, eyes, mouth, neck) %>%
gather(aoi, percent, c(eyes, mouth, neck)) %>%
group_by(id, maingroup, direction, aoi) %>%
mutate(percent = mean(percent, na.rm = TRUE)) %>%
distinct() %>%
group_by(maingroup, aoi) %>%
summarise(mean = mean(percent, na.rm = TRUE),
sd = sd(percent, na.rm = TRUE),
count = n()/2,
se = sd/sqrt(count))
# I need to first collapse across stories for each participant...here I didn't. Must fix later.
aoi3_interactions_maingroupaoi %>%
ggplot(aes(x = aoi, y = mean, fill = maingroup)) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_errorbar(aes(ymin = mean-se, ymax = mean+se), position = position_dodge(0.9), width = 0.5) +
labs(title = "MainGroup & AOI Interaction 1", subtitle = "Error bars represent SE", x = "", y = "percent looking") +
scale_y_continuous(labels = percent)aoi3_interactions_maingroupaoi %>%
ggplot(aes(x = maingroup, y = mean, fill = aoi)) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_errorbar(aes(ymin = mean-se, ymax = mean+se), position = position_dodge(0.9), width = 0.5) +
labs(title = "MainGroup & AOI Interaction 2", subtitle = "Error bars represent SE", x = "", y = "percent looking") +
scale_y_continuous(labels = percent)First are the direction:aoi charts The error bars are not 100% accurate, I took a quick-n-easy way around
aoi3_interactions_directionaoi <- fulldata %>%
filter(eye_exclude == FALSE) %>%
select(id, participant, maingroup, direction, eyes, mouth, neck) %>%
gather(aoi, percent, c(eyes, mouth, neck)) %>%
group_by(id, maingroup, direction, aoi) %>%
mutate(percent = mean(percent, na.rm = TRUE)) %>%
distinct() %>%
group_by(direction, aoi) %>%
summarise(mean = mean(percent, na.rm = TRUE),
sd = sd(percent, na.rm = TRUE),
count = n(),
se = sd/sqrt(count))
# I need to first collapse across stories for each participant...here I didn't. Must fix later.
aoi3_interactions_directionaoi %>%
ggplot(aes(x = aoi, y = mean, fill = direction)) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_errorbar(aes(ymin = mean-se, ymax = mean+se), position = position_dodge(0.9), width = 0.5) +
labs(title = "MainGroup & Direction Interaction 1", subtitle = "Error bars represent SE", x = "", y = "percent looking") +
scale_y_continuous(labels = percent)aoi3_interactions_directionaoi %>%
ggplot(aes(x = direction, y = mean, fill = aoi)) +
geom_bar(stat = "identity", position = position_dodge()) +
geom_errorbar(aes(ymin = mean-se, ymax = mean+se), position = position_dodge(0.9), width = 0.5) +
labs(title = "MainGroup & Direction Interaction 2", subtitle = "Error bars represent SE", x = "", y = "percent looking") +
scale_y_continuous(labels = percent)Let’s get tables of our means here, in various configurations
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.315 0.10508 1.936 0.129
direction 1 0.000 0.00000 0.000 0.999
maingroup:direction 3 0.013 0.00425 0.078 0.972
Residuals 95 5.157 0.05429
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.1234 0.04114 0.863 0.467
Residuals 48 2.2876 0.04766
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.2046 0.06820 1.117 0.352
Residuals 47 2.8695 0.06105
Df Sum Sq Mean Sq F value Pr(>F)
direction 1 0.000 0.00000 0.000 0.995
aoasl 1 0.047 0.04669 0.821 0.367
age 1 0.009 0.00903 0.159 0.691
direction:aoasl 1 0.000 0.00008 0.001 0.971
direction:age 1 0.014 0.01362 0.239 0.626
aoasl:age 1 0.003 0.00258 0.045 0.832
direction:aoasl:age 1 0.007 0.00717 0.126 0.723
Residuals 95 5.406 0.05690
Call:
lm(formula = eyes ~ aoasl * age, data = filter(aoi3_data, direction ==
"forward"))
Residuals:
Min 1Q Median 3Q Max
-0.23543 -0.16625 -0.09484 0.13048 0.60413
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.1114653 0.2205845 0.505 0.616
aoasl 0.0093545 0.0157958 0.592 0.556
age 0.0019633 0.0063910 0.307 0.760
aoasl:age -0.0002108 0.0004897 -0.431 0.669
Residual standard error: 0.2225 on 48 degrees of freedom
Multiple R-squared: 0.01437, Adjusted R-squared: -0.04723
F-statistic: 0.2333 on 3 and 48 DF, p-value: 0.8727
Call:
lm(formula = eyes ~ aoasl * age, data = filter(aoi3_data, direction ==
"reversed"))
Residuals:
Min 1Q Median 3Q Max
-0.25646 -0.18517 -0.08579 0.17714 0.62517
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.095e-01 2.517e-01 0.435 0.666
aoasl 1.935e-03 1.803e-02 0.107 0.915
age 2.005e-03 7.300e-03 0.275 0.785
aoasl:age 5.266e-05 5.588e-04 0.094 0.925
Residual standard error: 0.2539 on 47 degrees of freedom
Multiple R-squared: 0.01448, Adjusted R-squared: -0.04843
F-statistic: 0.2302 on 3 and 47 DF, p-value: 0.8749
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.499 0.16623 2.533 0.0616 .
direction 1 0.246 0.24582 3.745 0.0559 .
maingroup:direction 3 0.029 0.00955 0.146 0.9323
Residuals 95 6.235 0.06563
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.1506 0.05021 0.909 0.444
Residuals 48 2.6511 0.05523
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.368 0.12263 1.608 0.2
Residuals 47 3.584 0.07625
Df Sum Sq Mean Sq F value Pr(>F)
direction 1 0.255 0.2546 3.875 0.05191 .
aoasl 1 0.037 0.0368 0.561 0.45580
age 1 0.459 0.4593 6.991 0.00958 **
direction:aoasl 1 0.003 0.0027 0.041 0.84063
direction:age 1 0.009 0.0089 0.136 0.71335
aoasl:age 1 0.001 0.0011 0.017 0.89558
direction:aoasl:age 1 0.003 0.0030 0.046 0.83099
Residuals 95 6.242 0.0657
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Call:
lm(formula = mouth ~ aoasl * age, data = filter(aoi3_data, direction ==
"forward"))
Residuals:
Min 1Q Median 3Q Max
-0.44000 -0.20113 0.06621 0.19821 0.31155
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.3649728 0.2314635 1.577 0.121
aoasl 0.0049408 0.0165748 0.298 0.767
age 0.0084860 0.0067063 1.265 0.212
aoasl:age -0.0001379 0.0005138 -0.268 0.790
Residual standard error: 0.2335 on 48 degrees of freedom
Multiple R-squared: 0.06612, Adjusted R-squared: 0.007748
F-statistic: 1.133 on 3 and 48 DF, p-value: 0.3453
Call:
lm(formula = mouth ~ aoasl * age, data = filter(aoi3_data, direction ==
"reversed"))
Residuals:
Min 1Q Median 3Q Max
-0.57201 -0.20495 0.01672 0.20824 0.37940
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.625e-01 2.754e-01 0.953 0.345
aoasl -8.955e-04 1.972e-02 -0.045 0.964
age 8.966e-03 7.986e-03 1.123 0.267
aoasl:age 3.289e-05 6.112e-04 0.054 0.957
Residual standard error: 0.2777 on 47 degrees of freedom
Multiple R-squared: 0.08266, Adjusted R-squared: 0.02411
F-statistic: 1.412 on 3 and 47 DF, p-value: 0.2511
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.195 0.06505 1.584 0.198
direction 1 0.095 0.09484 2.309 0.132
maingroup:direction 3 0.040 0.01326 0.323 0.809
Residuals 95 3.902 0.04107
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.0557 0.01857 0.583 0.629
Residuals 48 1.5296 0.03187
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.1758 0.05860 1.161 0.335
Residuals 47 2.3723 0.05048
Df Sum Sq Mean Sq F value Pr(>F)
direction 1 0.098 0.09830 2.499 0.11721
aoasl 1 0.048 0.04800 1.220 0.27206
age 1 0.282 0.28158 7.160 0.00878 **
direction:aoasl 1 0.000 0.00005 0.001 0.97094
direction:age 1 0.024 0.02403 0.611 0.43638
aoasl:age 1 0.034 0.03404 0.866 0.35455
direction:aoasl:age 1 0.010 0.00971 0.247 0.62033
Residuals 95 3.736 0.03933
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Call:
lm(formula = neck ~ aoasl * age, data = filter(aoi3_data, direction ==
"forward"))
Residuals:
Min 1Q Median 3Q Max
-0.21315 -0.09850 -0.05872 0.03555 0.59574
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.4618934 0.1722346 2.682 0.0100 *
aoasl -0.0181887 0.0123335 -1.475 0.1468
age -0.0091690 0.0049902 -1.837 0.0723 .
aoasl:age 0.0004405 0.0003823 1.152 0.2550
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.1737 on 48 degrees of freedom
Multiple R-squared: 0.08614, Adjusted R-squared: 0.02902
F-statistic: 1.508 on 3 and 48 DF, p-value: 0.2244
Call:
lm(formula = neck ~ aoasl * age, data = filter(aoi3_data, direction ==
"reversed"))
Residuals:
Min 1Q Median 3Q Max
-0.26322 -0.14892 -0.05726 0.06747 0.61028
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.5422914 0.2187298 2.479 0.0168 *
aoasl -0.0097882 0.0156634 -0.625 0.5351
age -0.0096767 0.0063433 -1.525 0.1338
aoasl:age 0.0001337 0.0004855 0.275 0.7842
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.2206 on 47 degrees of freedom
Multiple R-squared: 0.1024, Adjusted R-squared: 0.04508
F-statistic: 1.787 on 3 and 47 DF, p-value: 0.1626
We originally defined FaceChest such that
BUT. Chin is actually neck. It’s not even part of the face if you think about it. So I’m redefining FaceChest as:
So let’s do this. Then see what’s happening across groups for FaceChest.
Cool. Next we’ll do error bar charts using the new FaceChest across groups.
facechest_info <- fulldata %>%
filter(eye_exclude == FALSE) %>%
group_by(maingroup, direction, participant) %>%
summarise(facechest = mean(facechest, na.rm = TRUE)) %>%
group_by(maingroup, direction) %>%
summarise(mean = mean(facechest),
sd = sd(facechest),
n = n(),
se = sd/sqrt(n))
ggplot(facechest_info, aes(x = maingroup, y = mean, fill = direction, color = direction)) +
geom_point(stat = "identity", position = position_dodge(0.5), size = 2) +
geom_errorbar(aes(ymin = mean-se, ymax = mean+se), position = position_dodge(0.5), width = 0.3, size = 1) +
labs(title = "FaceChest Ratio", subtitle = "Error bars represent SE", x = "", y = "facechest ratio") +
scale_y_continuous(limits = c(-1,1)) +
geom_hline(yintercept = 0, linetype = "dotted")Now let’s do the ANOVAs. Also skipping LSDs here.
Grouping rowwise data frame strips rowwise nature
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 1.317 0.4389 2.111 0.1040
direction 1 0.712 0.7116 3.422 0.0674 .
maingroup:direction 3 0.283 0.0942 0.453 0.7157
Residuals 95 19.754 0.2079
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 0.295 0.09847 0.608 0.613
Residuals 48 7.777 0.16202
Df Sum Sq Mean Sq F value Pr(>F)
maingroup 3 1.279 0.4264 1.673 0.185
Residuals 47 11.977 0.2548
Df Sum Sq Mean Sq F value Pr(>F)
direction 1 0.736 0.7363 3.722 0.05667 .
aoasl 1 0.014 0.0140 0.071 0.79077
age 1 2.218 2.2182 11.215 0.00116 **
direction:aoasl 1 0.024 0.0245 0.124 0.72574
direction:age 1 0.162 0.1617 0.818 0.36814
aoasl:age 1 0.026 0.0256 0.130 0.71972
direction:aoasl:age 1 0.093 0.0934 0.472 0.49369
Residuals 95 18.791 0.1978
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Call:
lm(formula = facechest ~ aoasl * age, data = filter(fc_data,
direction == "forward"))
Residuals:
Min 1Q Median 3Q Max
-1.1587 -0.1404 0.1393 0.2517 0.4754
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.0308724 0.3874355 -0.080 0.9368
aoasl 0.0306476 0.0277438 1.105 0.2748
age 0.0207509 0.0112253 1.849 0.0707 .
aoasl:age -0.0007246 0.0008600 -0.843 0.4037
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.3908 on 48 degrees of freedom
Multiple R-squared: 0.09183, Adjusted R-squared: 0.03507
F-statistic: 1.618 on 3 and 48 DF, p-value: 0.1975
Call:
lm(formula = facechest ~ aoasl * age, data = filter(fc_data,
direction == "reversed"))
Residuals:
Min 1Q Median 3Q Max
-1.19830 -0.16427 0.08831 0.31808 0.62208
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.1552602 0.4895982 -0.317 0.753
aoasl 0.0004786 0.0350606 0.014 0.989
age 0.0204410 0.0141987 1.440 0.157
aoasl:age 0.0002265 0.0010868 0.208 0.836
Residual standard error: 0.4938 on 47 degrees of freedom
Multiple R-squared: 0.1355, Adjusted R-squared: 0.08032
F-statistic: 2.456 on 3 and 47 DF, p-value: 0.07467
Next we’re going to correlate our eye gaze metrics (Eye, Mouth, Neck, and FaceChest) with lexical recall and gist. Okay! But remember we have a slightly smaller dataset here because we’ve excluded some participants for having bad eye data (but they had valid behavioral data so we kept them in the AoA-Performance correlations above).
We also removed gist_forward column.
eyeperf <- fulldata %>%
filter(eye_exclude == FALSE) %>%
select(participant, maingroup, hearing, direction, acc, gist, eyes, mouth, neck, facechest) %>%
group_by(maingroup, participant, direction) %>%
mutate(gist = mean(gist, na.rm = TRUE),
lex = mean(acc, na.rm = TRUE),
eyes = mean(eyes, na.rm = TRUE),
mouth = mean(mouth, na.rm = TRUE),
neck = mean(neck, na.rm = TRUE),
facechest = mean(facechest, na.rm = TRUE)) %>%
ungroup() %>%
select(maingroup, participant, hearing, direction, gist, lex, eyes, mouth, neck, facechest) %>%
distinct() %>%
gather(metric, value, gist:facechest) %>%
unite(metricvalue, c(metric, direction), sep = "_") %>%
spread(metricvalue, value) %>%
select(-participant, -maingroup) %>%
select(hearing, gist_reversed, lex_forward, lex_reversed, eyes_forward, eyes_reversed,
mouth_forward, mouth_reversed, neck_forward, neck_reversed, facechest_forward, facechest_reversed)Grouping rowwise data frame strips rowwise nature
eyeperf_deaf <- eyeperf %>% filter(hearing == "Deaf") %>% select(-hearing)
eyeperf_hearing <- eyeperf %>% filter(hearing == "Hearing") %>% select(-hearing)
eyeperf_all <- eyeperf %>% select(-hearing)
# Correlations for Deaf
print("DEAF Correlations - Pearson's r")[1] "DEAF Correlations - Pearson's r"
#corstarsl(lexgist_deaf)
Hmisc::rcorr(as.matrix(eyeperf_deaf))$r gist_reversed lex_forward lex_reversed eyes_forward eyes_reversed mouth_forward
gist_reversed 1.00000000 -0.1103272 0.30316901 -0.06319147 0.02254098 0.1399812
lex_forward -0.11032724 1.0000000 0.12103733 0.19560269 0.19460939 0.1127365
lex_reversed 0.30316901 0.1210373 1.00000000 -0.09834590 -0.07989090 0.1398463
eyes_forward -0.06319147 0.1956027 -0.09834590 1.00000000 0.53012073 -0.4038958
eyes_reversed 0.02254098 0.1946094 -0.07989090 0.53012073 1.00000000 -0.1084938
mouth_forward 0.13998124 0.1127365 0.13984634 -0.40389580 -0.10849377 1.0000000
mouth_reversed 0.06590948 0.1511229 0.11828493 -0.18798503 -0.45147687 0.6487395
neck_forward -0.10845388 -0.2818219 -0.06254636 -0.40213531 -0.32258892 -0.6652489
neck_reversed -0.07553297 -0.2951812 -0.01236971 -0.29756692 -0.42235607 -0.5483285
facechest_forward 0.10233361 0.2796232 0.05057043 0.37868726 0.32650983 0.6918055
facechest_reversed 0.08644924 0.3039166 0.03749677 0.28118142 0.43328831 0.5811273
mouth_reversed neck_forward neck_reversed facechest_forward facechest_reversed
gist_reversed 0.06590948 -0.10845388 -0.07553297 0.10233361 0.08644924
lex_forward 0.15112290 -0.28182188 -0.29518121 0.27962315 0.30391663
lex_reversed 0.11828493 -0.06254636 -0.01236971 0.05057043 0.03749677
eyes_forward -0.18798503 -0.40213531 -0.29756692 0.37868726 0.28118142
eyes_reversed -0.45147687 -0.32258892 -0.42235607 0.32650983 0.43328831
mouth_forward 0.64873952 -0.66524893 -0.54832852 0.69180554 0.58112735
mouth_reversed 1.00000000 -0.52286172 -0.59771758 0.49638316 0.59842563
neck_forward -0.52286172 1.00000000 0.82565296 -0.99141806 -0.83648926
neck_reversed -0.59771758 0.82565296 1.00000000 -0.79461950 -0.99196124
facechest_forward 0.49638316 -0.99141806 -0.79461950 1.00000000 0.81218421
facechest_reversed 0.59842563 -0.83648926 -0.99196124 0.81218421 1.00000000
print("DEAF Correlations - P-values")[1] "DEAF Correlations - P-values"
Hmisc::rcorr(as.matrix(eyeperf_deaf))$P gist_reversed lex_forward lex_reversed eyes_forward eyes_reversed mouth_forward
gist_reversed NA 0.5762360 0.1168234 0.749383585 0.909355255 4.774249e-01
lex_forward 0.5762360 NA 0.5395250 0.309208485 0.321023718 5.603910e-01
lex_reversed 0.1168234 0.5395250 NA 0.618567671 0.686127314 4.778537e-01
eyes_forward 0.7493836 0.3092085 0.6185677 NA 0.003712324 2.978758e-02
eyes_reversed 0.9093553 0.3210237 0.6861273 0.003712324 NA 5.826299e-01
mouth_forward 0.4774249 0.5603910 0.4778537 0.029787577 0.582629892 NA
mouth_reversed 0.7389667 0.4427051 0.5488533 0.338088512 0.015882316 1.883815e-04
neck_forward 0.5827693 0.1385770 0.7518624 0.030576543 0.094080464 8.235941e-05
neck_reversed 0.7024562 0.1272716 0.9501866 0.124081940 0.025159368 2.519354e-03
facechest_forward 0.6043367 0.1418142 0.7982931 0.042791159 0.089925263 3.228725e-05
facechest_reversed 0.6618134 0.1158789 0.8497523 0.147206817 0.021262891 1.183228e-03
mouth_reversed neck_forward neck_reversed facechest_forward facechest_reversed
gist_reversed 0.7389666674 5.827693e-01 7.024562e-01 6.043367e-01 6.618134e-01
lex_forward 0.4427050811 1.385770e-01 1.272716e-01 1.418142e-01 1.158789e-01
lex_reversed 0.5488532932 7.518624e-01 9.501866e-01 7.982931e-01 8.497523e-01
eyes_forward 0.3380885118 3.057654e-02 1.240819e-01 4.279116e-02 1.472068e-01
eyes_reversed 0.0158823163 9.408046e-02 2.515937e-02 8.992526e-02 2.126289e-02
mouth_forward 0.0001883815 8.235941e-05 2.519354e-03 3.228725e-05 1.183228e-03
mouth_reversed NA 4.307483e-03 7.826592e-04 7.216113e-03 7.685904e-04
neck_forward 0.0043074830 NA 6.358068e-08 0.000000e+00 2.946681e-08
neck_reversed 0.0007826592 6.358068e-08 NA 4.429714e-07 0.000000e+00
facechest_forward 0.0072161132 0.000000e+00 4.429714e-07 NA 1.541998e-07
facechest_reversed 0.0007685904 2.946681e-08 0.000000e+00 1.541998e-07 NA
cat(paste("","\n",""))# Correlations for Hearing
print("HEARING Correlations - Pearson's r")[1] "HEARING Correlations - Pearson's r"
#corstarsl(lexgist_hearing)
Hmisc::rcorr(as.matrix(eyeperf_hearing))$r gist_reversed lex_forward lex_reversed eyes_forward eyes_reversed mouth_forward
gist_reversed 1.000000000 0.32119471 0.61989301 -0.2017262 -0.003896097 -0.02203918
lex_forward 0.321194708 1.00000000 0.23279549 -0.2064124 -0.043613102 0.04471777
lex_reversed 0.619893014 0.23279549 1.00000000 -0.0936432 -0.128554240 -0.12913127
eyes_forward -0.201726153 -0.20641239 -0.09364320 1.0000000 0.794651926 -0.75736409
eyes_reversed -0.003896097 -0.04361310 -0.12855424 0.7946519 1.000000000 -0.53289974
mouth_forward -0.022039175 0.04471777 -0.12913127 -0.7573641 -0.532899737 1.00000000
mouth_reversed -0.057827983 -0.08355581 0.01769962 -0.4947033 -0.608459473 0.73505580
neck_forward 0.367403537 0.36551589 0.36037686 -0.5478414 -0.524459183 -0.08094060
neck_reversed 0.223993644 0.27462074 0.24863580 -0.5678435 -0.667670012 0.06470188
facechest_forward -0.340341955 -0.28030962 -0.29633671 0.5328411 0.513289094 0.14471392
facechest_reversed -0.163039193 -0.15098999 -0.19097045 0.5098403 0.602644563 0.05395970
mouth_reversed neck_forward neck_reversed facechest_forward facechest_reversed
gist_reversed -0.05782798 0.3674035 0.22399364 -0.3403420 -0.1630392
lex_forward -0.08355581 0.3655159 0.27462074 -0.2803096 -0.1509900
lex_reversed 0.01769962 0.3603769 0.24863580 -0.2963367 -0.1909705
eyes_forward -0.49470326 -0.5478414 -0.56784350 0.5328411 0.5098403
eyes_reversed -0.60845947 -0.5244592 -0.66767001 0.5132891 0.6026446
mouth_forward 0.73505580 -0.0809406 0.06470188 0.1447139 0.0539597
mouth_reversed 1.00000000 -0.0758556 -0.09060995 0.1957614 0.2372879
neck_forward -0.07585560 1.0000000 0.76188785 -0.9424162 -0.7260022
neck_reversed -0.09060995 0.7618878 1.00000000 -0.7833102 -0.9351352
facechest_forward 0.19576141 -0.9424162 -0.78331023 1.0000000 0.8350726
facechest_reversed 0.23728788 -0.7260022 -0.93513525 0.8350726 1.0000000
print("HEARING Correlations - P-values")[1] "HEARING Correlations - P-values"
Hmisc::rcorr(as.matrix(eyeperf_hearing))$P gist_reversed lex_forward lex_reversed eyes_forward eyes_reversed mouth_forward
gist_reversed NA 0.13506603 0.001604978 3.559903e-01 9.859236e-01 9.204923e-01
lex_forward 0.135066028 NA 0.285087190 3.446869e-01 8.433655e-01 8.394476e-01
lex_reversed 0.001604978 0.28508719 NA 6.708451e-01 5.588320e-01 5.570536e-01
eyes_forward 0.355990294 0.34468693 0.670845077 NA 5.929025e-06 2.859607e-05
eyes_reversed 0.985923639 0.84336552 0.558831962 5.929025e-06 NA 8.840848e-03
mouth_forward 0.920492311 0.83944758 0.557053614 2.859607e-05 8.840848e-03 NA
mouth_reversed 0.793254811 0.70466052 0.936112687 1.640479e-02 2.065194e-03 6.461917e-05
neck_forward 0.084589444 0.08632257 0.091175442 6.807338e-03 1.019589e-02 7.135195e-01
neck_reversed 0.304204139 0.20474801 0.252624987 4.707219e-03 4.996113e-04 7.692911e-01
facechest_forward 0.112046749 0.19514544 0.169752614 8.849713e-03 1.224782e-02 5.100229e-01
facechest_reversed 0.457300336 0.49164189 0.382738792 1.294574e-02 2.339301e-03 8.068219e-01
mouth_reversed neck_forward neck_reversed facechest_forward facechest_reversed
gist_reversed 7.932548e-01 8.458944e-02 3.042041e-01 1.120467e-01 4.573003e-01
lex_forward 7.046605e-01 8.632257e-02 2.047480e-01 1.951454e-01 4.916419e-01
lex_reversed 9.361127e-01 9.117544e-02 2.526250e-01 1.697526e-01 3.827388e-01
eyes_forward 1.640479e-02 6.807338e-03 4.707219e-03 8.849713e-03 1.294574e-02
eyes_reversed 2.065194e-03 1.019589e-02 4.996113e-04 1.224782e-02 2.339301e-03
mouth_forward 6.461917e-05 7.135195e-01 7.692911e-01 5.100229e-01 8.068219e-01
mouth_reversed NA 7.308466e-01 6.809521e-01 3.706863e-01 2.756272e-01
neck_forward 7.308466e-01 NA 2.398635e-05 1.861311e-11 8.797435e-05
neck_reversed 6.809521e-01 2.398635e-05 NA 9.878377e-06 6.290368e-11
facechest_forward 3.706863e-01 1.861311e-11 9.878377e-06 NA 7.177950e-07
facechest_reversed 2.756272e-01 8.797435e-05 6.290368e-11 7.177950e-07 NA
cat(paste("","\n",""))# Correlations for All
print("ALL Correlations - Pearson's r")[1] "ALL Correlations - Pearson's r"
#corstarsl(lexgist_all)
Hmisc::rcorr(as.matrix(eyeperf_all))$r gist_reversed lex_forward lex_reversed eyes_forward eyes_reversed mouth_forward
gist_reversed 1.0000000000 0.157367334 0.44831455 -0.1583381 -0.033147462 0.12706694
lex_forward 0.1573673338 1.000000000 0.23866823 -0.1346806 -0.007873518 0.11668780
lex_reversed 0.4483145475 0.238668233 1.00000000 -0.1345993 -0.140279055 0.05451585
eyes_forward -0.1583380550 -0.134680599 -0.13459931 1.0000000 0.706692934 -0.62307096
eyes_reversed -0.0331474617 -0.007873518 -0.14027905 0.7066929 1.000000000 -0.36512721
mouth_forward 0.1270669401 0.116687804 0.05451585 -0.6230710 -0.365127206 1.00000000
mouth_reversed 0.1034677997 0.081888258 0.14056188 -0.3857141 -0.544273436 0.70370090
neck_forward 0.0342302844 0.051669102 0.10643122 -0.4273281 -0.388957769 -0.40481210
neck_reversed -0.0002581948 0.003536053 0.07954131 -0.3926680 -0.503218710 -0.28553602
facechest_forward -0.0335624404 -0.031654894 -0.09553912 0.4281833 0.402936906 0.43687293
facechest_reversed 0.0425947122 0.063717648 -0.02840233 0.3631589 0.482238919 0.34413567
mouth_reversed neck_forward neck_reversed facechest_forward facechest_reversed
gist_reversed 0.10346780 0.03423028 -0.0002581948 -0.03356244 0.04259471
lex_forward 0.08188826 0.05166910 0.0035360528 -0.03165489 0.06371765
lex_reversed 0.14056188 0.10643122 0.0795413107 -0.09553912 -0.02840233
eyes_forward -0.38571414 -0.42732805 -0.3926679790 0.42818332 0.36315894
eyes_reversed -0.54427344 -0.38895777 -0.5032187104 0.40293691 0.48223892
mouth_forward 0.70370090 -0.40481210 -0.2855360210 0.43687293 0.34413567
mouth_reversed 1.00000000 -0.31946859 -0.3897527158 0.35403353 0.45460728
neck_forward -0.31946859 1.00000000 0.7993095517 -0.96537608 -0.76219910
neck_reversed -0.38975272 0.79930955 1.0000000000 -0.78893071 -0.95769274
facechest_forward 0.35403353 -0.96537608 -0.7889307141 1.00000000 0.81137252
facechest_reversed 0.45460728 -0.76219910 -0.9576927423 0.81137252 1.00000000
print("ALL Correlations - P-values")[1] "ALL Correlations - P-values"
Hmisc::rcorr(as.matrix(eyeperf_all))$P gist_reversed lex_forward lex_reversed eyes_forward eyes_reversed mouth_forward
gist_reversed NA 0.27008993 0.0009694904 2.671087e-01 8.173808e-01 3.742438e-01
lex_forward 0.2700899346 NA 0.0916709472 3.411308e-01 9.562699e-01 4.100460e-01
lex_reversed 0.0009694904 0.09167095 NA 3.463483e-01 3.261871e-01 7.039810e-01
eyes_forward 0.2671087463 0.34113082 0.3463483357 NA 6.830266e-09 8.097570e-07
eyes_reversed 0.8173807987 0.95626990 0.3261870511 6.830266e-09 NA 8.425391e-03
mouth_forward 0.3742437833 0.41004603 0.7039809873 8.097570e-07 8.425391e-03 NA
mouth_reversed 0.4699673532 0.56782200 0.3252028385 5.184763e-03 3.651371e-05 8.423032e-09
neck_forward 0.8115222617 0.71602452 0.4572739900 1.579676e-03 4.789468e-03 2.913237e-03
neck_reversed 0.9985652716 0.98035289 0.5790064531 4.369926e-03 1.673548e-04 4.224662e-02
facechest_forward 0.8151343981 0.82371178 0.5048365664 1.542092e-03 3.372262e-03 1.203117e-03
facechest_reversed 0.7666339865 0.65689363 0.8431666495 8.811831e-03 3.391156e-04 1.340835e-02
mouth_reversed neck_forward neck_reversed facechest_forward facechest_reversed
gist_reversed 4.699674e-01 8.115223e-01 9.985653e-01 8.151344e-01 7.666340e-01
lex_forward 5.678220e-01 7.160245e-01 9.803529e-01 8.237118e-01 6.568936e-01
lex_reversed 3.252028e-01 4.572740e-01 5.790065e-01 5.048366e-01 8.431666e-01
eyes_forward 5.184763e-03 1.579676e-03 4.369926e-03 1.542092e-03 8.811831e-03
eyes_reversed 3.651371e-05 4.789468e-03 1.673548e-04 3.372262e-03 3.391156e-04
mouth_forward 8.423032e-09 2.913237e-03 4.224662e-02 1.203117e-03 1.340835e-02
mouth_reversed NA 2.230426e-02 4.696719e-03 1.081053e-02 8.043284e-04
neck_forward 2.230426e-02 NA 2.037925e-12 0.000000e+00 8.169354e-11
neck_reversed 4.696719e-03 2.037925e-12 NA 6.159073e-12 0.000000e+00
facechest_forward 1.081053e-02 0.000000e+00 6.159073e-12 NA 5.182521e-13
facechest_reversed 8.043284e-04 8.169354e-11 0.000000e+00 5.182521e-13 NA
I’m also including nicely formatted tables with *** indicators of significance for quick referencing. Order: Deaf, Hearing, All.
corstarsl(eyeperf_deaf)corstarsl(eyeperf_hearing)corstarsl(eyeperf_all)And the correlation table.
ggpairs(eyeperf, columns = c(2:11), aes(color = hearing))
plot: [1,1] [=---------------------------------------------------------------------------] 1% est: 0s
plot: [1,2] [==--------------------------------------------------------------------------] 2% est:10s
plot: [1,3] [==--------------------------------------------------------------------------] 3% est:11s
plot: [1,4] [===-------------------------------------------------------------------------] 4% est:11s
plot: [1,5] [====------------------------------------------------------------------------] 5% est:11s
plot: [1,6] [=====-----------------------------------------------------------------------] 6% est:11s
plot: [1,7] [=====-----------------------------------------------------------------------] 7% est:10s
plot: [1,8] [======----------------------------------------------------------------------] 8% est:10s
plot: [1,9] [=======---------------------------------------------------------------------] 9% est:11s
plot: [1,10] [========-------------------------------------------------------------------] 10% est:10s
plot: [2,1] [========--------------------------------------------------------------------] 11% est:10s
plot: [2,2] [=========-------------------------------------------------------------------] 12% est:10s
plot: [2,3] [==========------------------------------------------------------------------] 13% est:11s
plot: [2,4] [===========-----------------------------------------------------------------] 14% est:11s
plot: [2,5] [===========-----------------------------------------------------------------] 15% est:11s
plot: [2,6] [============----------------------------------------------------------------] 16% est:10s
plot: [2,7] [=============---------------------------------------------------------------] 17% est:10s
plot: [2,8] [==============--------------------------------------------------------------] 18% est:10s
plot: [2,9] [==============--------------------------------------------------------------] 19% est:10s
plot: [2,10] [===============------------------------------------------------------------] 20% est:10s
plot: [3,1] [================------------------------------------------------------------] 21% est: 9s
plot: [3,2] [=================-----------------------------------------------------------] 22% est: 9s
plot: [3,3] [=================-----------------------------------------------------------] 23% est: 9s
plot: [3,4] [==================----------------------------------------------------------] 24% est: 9s
plot: [3,5] [===================---------------------------------------------------------] 25% est: 9s
plot: [3,6] [====================--------------------------------------------------------] 26% est: 9s
plot: [3,7] [=====================-------------------------------------------------------] 27% est: 9s
plot: [3,8] [=====================-------------------------------------------------------] 28% est: 9s
plot: [3,9] [======================------------------------------------------------------] 29% est: 9s
plot: [3,10] [======================-----------------------------------------------------] 30% est: 9s
plot: [4,1] [========================----------------------------------------------------] 31% est: 9s
plot: [4,2] [========================----------------------------------------------------] 32% est: 9s
plot: [4,3] [=========================---------------------------------------------------] 33% est: 9s
plot: [4,4] [==========================--------------------------------------------------] 34% est: 8s
plot: [4,5] [===========================-------------------------------------------------] 35% est: 8s
plot: [4,6] [===========================-------------------------------------------------] 36% est: 8s
plot: [4,7] [============================------------------------------------------------] 37% est: 8s
plot: [4,8] [=============================-----------------------------------------------] 38% est: 8s
plot: [4,9] [==============================----------------------------------------------] 39% est: 8s
plot: [4,10] [==============================---------------------------------------------] 40% est: 8s
plot: [5,1] [===============================---------------------------------------------] 41% est: 8s
plot: [5,2] [================================--------------------------------------------] 42% est: 8s
plot: [5,3] [=================================-------------------------------------------] 43% est: 7s
plot: [5,4] [=================================-------------------------------------------] 44% est: 7s
plot: [5,5] [==================================------------------------------------------] 45% est: 7s
plot: [5,6] [===================================-----------------------------------------] 46% est: 7s
plot: [5,7] [====================================----------------------------------------] 47% est: 7s
plot: [5,8] [====================================----------------------------------------] 48% est: 7s
plot: [5,9] [=====================================---------------------------------------] 49% est: 7s
plot: [5,10] [======================================-------------------------------------] 50% est: 7s
plot: [6,1] [=======================================-------------------------------------] 51% est: 6s
plot: [6,2] [========================================------------------------------------] 52% est: 6s
plot: [6,3] [========================================------------------------------------] 53% est: 6s
plot: [6,4] [=========================================-----------------------------------] 54% est: 6s
plot: [6,5] [==========================================----------------------------------] 55% est: 6s
plot: [6,6] [===========================================---------------------------------] 56% est: 6s
plot: [6,7] [===========================================---------------------------------] 57% est: 6s
plot: [6,8] [============================================--------------------------------] 58% est: 6s
plot: [6,9] [=============================================-------------------------------] 59% est: 6s
plot: [6,10] [=============================================------------------------------] 60% est: 6s
plot: [7,1] [==============================================------------------------------] 61% est: 5s
plot: [7,2] [===============================================-----------------------------] 62% est: 5s
plot: [7,3] [================================================----------------------------] 63% est: 5s
plot: [7,4] [=================================================---------------------------] 64% est: 5s
plot: [7,5] [=================================================---------------------------] 65% est: 5s
plot: [7,6] [==================================================--------------------------] 66% est: 5s
plot: [7,7] [===================================================-------------------------] 67% est: 5s
plot: [7,8] [====================================================------------------------] 68% est: 4s
plot: [7,9] [====================================================------------------------] 69% est: 4s
plot: [7,10] [====================================================-----------------------] 70% est: 4s
plot: [8,1] [======================================================----------------------] 71% est: 4s
plot: [8,2] [=======================================================---------------------] 72% est: 4s
plot: [8,3] [=======================================================---------------------] 73% est: 4s
plot: [8,4] [========================================================--------------------] 74% est: 4s
plot: [8,5] [=========================================================-------------------] 75% est: 3s
plot: [8,6] [==========================================================------------------] 76% est: 3s
plot: [8,7] [===========================================================-----------------] 77% est: 3s
plot: [8,8] [===========================================================-----------------] 78% est: 3s
plot: [8,9] [============================================================----------------] 79% est: 3s
plot: [8,10] [============================================================---------------] 80% est: 3s
plot: [9,1] [==============================================================--------------] 81% est: 3s
plot: [9,2] [==============================================================--------------] 82% est: 3s
plot: [9,3] [===============================================================-------------] 83% est: 2s
plot: [9,4] [================================================================------------] 84% est: 2s
plot: [9,5] [=================================================================-----------] 85% est: 2s
plot: [9,6] [=================================================================-----------] 86% est: 2s
plot: [9,7] [==================================================================----------] 87% est: 2s
plot: [9,8] [===================================================================---------] 88% est: 2s
plot: [9,9] [====================================================================--------] 89% est: 2s
plot: [9,10] [====================================================================-------] 90% est: 1s
plot: [10,1] [====================================================================-------] 91% est: 1s
plot: [10,2] [=====================================================================------] 92% est: 1s
plot: [10,3] [======================================================================-----] 93% est: 1s
plot: [10,4] [======================================================================-----] 94% est: 1s
plot: [10,5] [=======================================================================----] 95% est: 1s
plot: [10,6] [========================================================================---] 96% est: 1s
plot: [10,7] [=========================================================================--] 97% est: 0s
plot: [10,8] [==========================================================================-] 98% est: 0s
plot: [10,9] [==========================================================================-] 99% est: 0s
plot: [10,10] [==========================================================================]100% est: 0s
And finally, we’re going to do heat maps.
eyegaze_heat <- fulldata %>%
ungroup() %>%
filter(eye_exclude == FALSE) %>%
select(id:direction, belly, lowerchest, midchest, upperchest, neck, mouth, eyes, forehead) %>%
gather(aoi, percent, belly:forehead) %>%
group_by(maingroup, participant, direction, aoi) %>%
summarise(percent = mean(percent, na.rm=TRUE)) %>%
group_by(maingroup,direction,aoi) %>%
summarise(percent = mean(percent, na.rm=TRUE)) %>%
ungroup() %>%
filter(!is.na(aoi)) %>%
mutate(aoi = factor(aoi,levels=c("belly","lowerchest","midchest",
"upperchest","neck","mouth","eyes","forehead")))
eyegaze_heat_all <- fulldata %>%
ungroup() %>%
filter(eye_exclude == FALSE) %>%
select(id:direction, belly, lowerchest, midchest, upperchest, neck, mouth, eyes, forehead) %>%
gather(aoi, percent, belly:forehead) %>%
group_by(maingroup,participant,direction,aoi) %>%
dplyr::summarize(percent = mean(percent, na.rm=TRUE)) %>%
group_by(maingroup,direction,aoi) %>%
dplyr::summarize(percent = mean(percent, na.rm=TRUE)) %>%
group_by(maingroup,aoi) %>%
dplyr::summarize(percent = mean(percent, na.rm=TRUE)) %>%
ungroup() %>%
filter(!is.na(aoi)) %>%
mutate(aoi = factor(aoi,levels=c("belly","lowerchest","midchest",
"upperchest","neck","mouth","eyes","forehead")))
ggplot(eyegaze_heat, aes(x = maingroup, y = aoi)) +
geom_tile(aes(fill=percent),color="lightgray",na.rm=TRUE) +
# scale_fill_gradient(low = "lightblue",high = "steelblue") +
# scale_fill_distiller(type="div", palette = "RdYlBu") +
scale_fill_viridis(option = "viridis", direction=-1, limits = c(0,.75)) +
theme(axis.text.x=element_text(angle=45,hjust=1)) + facet_grid(. ~ direction) +
ylab("") + xlab("") + ggtitle("Eye Gaze Heat Map, by Direction")ggplot(eyegaze_heat_all, aes(x = maingroup, y = aoi)) +
geom_tile(aes(fill=percent),color="lightgray",na.rm=TRUE) +
# scale_fill_gradient(low = "lightblue",high = "steelblue") +
# scale_fill_distiller(type="div", palette = "RdYlBu") +
scale_fill_viridis(option = "viridis", direction=-1, limits = c(0,.75)) +
theme(axis.text.x=element_text(angle=45,hjust=1)) +
ylab("") + xlab("") + ggtitle("Eye Gaze Heat Map (Direction Collapsed)")Below are the p-values from the ANOVAs with 4 MainGroups. I never included Age as a covariate because it never improved the model. I included all ANOVAs for Gist and Lex Recall, and ANOVAs for any eye AOI or ratio was included only if either maingroup or direction was significant. Deafearly-Deaflate shows the LSD p-value for that comparison.
results1 <- structure(list(model = c("gist-maingroup-both", "gist-maingroup-fw",
"gist-maingroup-rv", "lexrecall-maingroup-both", "lexrecall-maingroup-fw",
"lexrecall-maingroup-rv", "mouth-maingroup-both", "upperchest-maingroup-both",
"upperchest-maingroup-rv", "facechest-maingroup-both", "moutheye-maingroup-both"
), maingroup = c(0, 0, 0.01, 0, 0.04, 0.02, 0.06, 0, 0.01, 0.1,
0.05), direction = c(0, NA, NA, 0, NA, NA, 0.06, 0.16, NA, 0.07,
0.48), `deafearly-deaflate` = c(0.1, 0.69, 0.02, 0.11, 0.95,
0.06, 0.38, 0.94, 0.52, 0.08, 0.68)), .Names = c("model", "maingroup",
"direction", "deafearly-deaflate"), class = c("tbl_df", "tbl",
"data.frame"), row.names = c(NA, -11L))
results1And below are the p-values from the ANCOVAs with Hearing & AoASL. I included all ANCOVAs for Gist and Lex Recall, and ANCOVAs for any eye AOI or ratio was included only if any main factor was significant. LSD comparisons are not needed because there’s only 2 levels in each group!
results2 <- structure(list(model = c("gist-both", "gist-fw", "gist-rv", "lex-both",
"lex-fw", "lex-rv", "forehead-fw", "mouth-both", "mouth-rv",
"upperchest-both", "upperchest-rv", "facechest-both", "moutheye-both"
), hearing = c(0, 0.00, 0.01, 0.01, 0.22, 0.03, 0.06, 0.01,
0.04, 0.01, 0.01, 0.35, 0.07), direction = c(0, NA, NA, 0, NA,
NA, NA, 0.05, NA, 0.21, NA, 0.05, 0.52), aoasl = c(0.22, 0.77,
0.19, 0.56, 0.58, 0.25, 0.08, 0.06, 0.12, 0.68, 0.95, 0.12, 0.44
), age = c(0.08, 0.01, 0.86, 0.09, 0.02, 0.7, 0.68, 0.28, 0.5,
0.02, 0.08, 0.00, 0.21)), .Names = c("model", "hearing", "direction",
"aoasl", "age"), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-13L))
results2Finally, the correlations for Deaf and Hearing separately are not significant. But there are significant correlations across all participants. I worry it is caused by HearingNovice, though…
results3 <- tribble(
~ metric, ~ AoASLcorrelationRvalue, ~ Pvalue,
"gist-fw", -0.32, 0.019,
"gist-rv", -0.39, 0.004,
"lex-fw", -0.08, 0.567,
"lex-rv", -0.34, 0.014
)
results3Let’s make triangle plots. “What?” you say. Read on.
library(ggtern)
fulldata %>%
ggtern(aes(x = eyes, y = mouth, z = neck)) + facet_grid(direction ~ maingroup) + stat_density_tern(geom='polygon', aes(fill=..level..), bins=4) + geom_point(color = "white", alpha = 0.5) + theme_bw()fulldata %>%
ggtern(aes(x = eyes, y = mouth, z = neck)) + facet_grid(direction ~ maingroup) + geom_confidence_tern(breaks = c(.5), color = "red") + geom_point() + theme_bw()About Adults:
-I think I want to write it up as an ANCOVA, with direction included. And LSD comparisons instead of Tukey. (I will do my own corrections) -You often have one liners summarizing results, in all tabs, those are nice, keep them coming. -(If you have reasons to present anything other than the ANCOVA, put that in your results tab)
I think if we do it this way then we get a really important story to tell: That the critical AoA cutoff is below 4 vs above 4 years of age (two groups 0-4 vs 4-13). This suggest early ASL is important.